import generator = require("@babel/generator");

import parser from "@babel/parser";

import traverse = require("@babel/traverse");

import types from "@babel/types";

import plugin from "./b-p.js";

// 使用示例
const code = "const a = 1;";

// ast
const ast = parser.parse(code);

// generate
const { code: newCode } = generator.default(plugin({ types }), {}, code);

// emit
console.log(newCode);
